package com.cloud.mall.sms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.sms.dto.SmsCouponHistoryDetail;
import com.cloud.mall.sms.out.SmsCouponHistoryOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "优惠券领取记录管理接口")
@RequestMapping("/couponHistory")
public interface SmsCouponHistoryService {


    @ApiOperation("根据优惠券id，使用状态，订单编号分页获取领取记录")
    @GetMapping("/list")
    BaseResponse<CommonPage<SmsCouponHistoryOut>> list(@RequestParam(value = "couponId", required = false) Long couponId,
                                                       @RequestParam(value = "useStatus", required = false) Integer useStatus,
                                                       @RequestParam(value = "orderSn", required = false) String orderSn,
                                                       @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

    @ApiOperation("添加优惠券领取记录")
    @PostMapping("/updateSmsCouponHistory")
    BaseResponse updateSmsCouponHistory(@RequestParam Long couponId);

    @ApiOperation("获取用户优惠券列表")
    @ApiImplicitParam(name = "useStatus", value = "优惠券筛选类型:0->未使用；1->已使用；2->已过期",
            allowableValues = "0,1,2", paramType = "query", dataType = "integer")
    @GetMapping("/memberCouponHistorylist")
    BaseResponse <List<SmsCouponHistoryOut>> memberCouponHistorylist(@RequestParam(value = "useStatus", required = false) Integer useStatus);

    @ApiOperation("获取登录会员购物车的相关优惠券")
    @ApiImplicitParam(name = "type", value = "使用可用:0->不可用；1->可用",
            defaultValue = "1", allowableValues = "0,1", paramType = "query", dataType = "integer")
    @GetMapping("/list/cart/{type}")
    BaseResponse<List<SmsCouponHistoryDetail>> listCart(@PathVariable Integer type);

}
